              {$CLEO .cm}
              

0000: NOP
thread 'def_jam'
                     {
:Map_Menus
03A4: name_thread 'MAP'
:START_MENU
:Map_Menu_01
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Map_Menu_01
if and
0AB0:   key_pressed 81//--- key = Backspace  
0AB0:   key_pressed 17//--- key = Backspace 
jf @Map_Menu_01   }
//010D: set_player $PLAYER_CHAR wanted_level_to 0
//01F0: set_max_wanted_level_to 0

//$ONMISSION = 1
//wait 500
:RELOADED
$HELP1 = audiostream.Load("cleo\missions\help1.mp3")
$HELP2 = audiostream.Load("cleo\missions\help2.mp3")
$HELP3 = audiostream.Load("cleo\missions\help3.mp3")     
$HELP4 = audiostream.Load("cleo\missions\help4.mp3")
$FIX = audiostream.Load("cleo\missions\repaircar.mp3")
model.load(#stallion)
model.load(#pony) 
model.load(#Rustler)    
model.load(#DODO)  
model.load(#Burrito) 
model.load(#peren)
model.load(#MAVERICK)
model.load(#VOODOO)    
model.load(#Bus)
model.load(#COACH)
model.load(#HUNTLEY)
038B: load_requested_models
//0ACD: show_text_highpriority "Welcome to my car scrapyard, I have my good old collections of these vehicles. If you hit to the wall, will stop working." time 5000
//wait 100
//0ACB: show_styled_text "John's Car Scrapyard" time 5000 style 5
$ONMISSION = 1
audiostream.PerformAction($HELP1, play)
0ACD: show_text_highpriority "Welcome to my car scrapyard, I have my good old collections of these vehicles. If you hit them to the wall, it will break." time 12000


062A: change_float_stat 24 to 1440.0 
actor.Health($PLAYER_ACTOR) = 9999999999   
$timer = 0
$score = 0
$Total_score = 0
select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
015F: set_camera_position  -2045.4017 -157.0852 35.3274 rotation 0.0 0.0 0.0 
0160: set_camera_point_at -2045.5762 -132.0002 35.2816 switchstyle 2 
actor.PutAt($PLAYER_ACTOR,   -2017.9875, -109.113, 35.0779)
wait 300
:BACK_MENU
actor.Health($PLAYER_ACTOR) = 9999999999
wait 100
0ADF: add_dynamic_GXT_entry "carsrap" text "John's Car Scrapyard"
//0ADF: add_dynamic_GXT_entry "figsel" text "~y~Mode Select"   
0ADF: add_dynamic_GXT_entry "carpick" text "Pick one of the car and see you can drive with hitting anything."
0ADF: add_dynamic_GXT_entry "car01" text "My Little Pony ~w~$8000"
0ADF: add_dynamic_GXT_entry "car02" text "The Stallion ~w~$10000"
0ADF: add_dynamic_GXT_entry "car03" text "Dodo Bird ~w~$800000"
0ADF: add_dynamic_GXT_entry "car04" text "Burrito Taco ~w~$9000"
0ADF: add_dynamic_GXT_entry "car05" text "Perennial Car ~w~$5000"
0ADF: add_dynamic_GXT_entry "car06" text "The Maverick ~w~$500000"
0ADF: add_dynamic_GXT_entry "car07" text "Gang Voodoo ~w~$20000"
0ADF: add_dynamic_GXT_entry "car08" text "The Bus ~w~$750000"
0ADF: add_dynamic_GXT_entry "car09" text "Coach Trip ~w~$850000"
0ADF: add_dynamic_GXT_entry "car10" text "Sexy Huntley ~w~$70000"
010B: 5@ = player $PLAYER_CHAR money

50@ = 0
0512: show_permanent_text_box 'carpick' 
08D4: 1@ = create_panel_with_title 'carsrap' position  240.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  0
08DB: set_panel 1@ column  0 header 'dummy' data 'car01' 'car02' 'car03' 'car04' 'car05' 'car06' 'car07' 'car08'  'car09' 'CAR10' 'dummy' 'dummy'
090E: set_panel 1@ active_row  0
01B4: set_player $PLAYER_CHAR can_move 0
03BF: set_player $PLAYER_CHAR ignored_by_everyone 1
:Map_Menu_1
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Map_Menu_21
if
00E1:   key_pressed  0  15//--- key = Enter/Exit
jf @Map_Menu_2
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
jump @cleanup //Map_Menu_21//--jump to menue exit

:Map_Menu_2
if
00E1:   key_pressed  0  16//--- key = Ped SPRINT
jf @Map_Menu_1
03E6: remove_text_box
08D7: 2@ = panel 1@ active_row//-- submit number of the highlighted button into variable
if  and
5@ > 8000
0039:   2@ ==  0  // integer values
jf @Map_Menu_3      

01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
//fade 0 500
//wait 2000
//fade 1 500

// actor $PLAYER_ACTOR remove_weapons
0@ = car.Create(#PONY, -2047.6837, -86.364, 35.1641)
car.Angle(0@) =  1.5691
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -8000
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0ACB: show_styled_text "~w~You brought a van!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING



:Map_Menu_3
if  and
5@ > 10000
0039:   2@ ==  1  // integer values
jf @Map_Menu_4
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
0@ = car.Create(#stallion, -2047.6837, -86.364, 35.1641)
car.Angle(0@) =  1.5691
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -10000
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0ACB: show_styled_text "~w~You brought a Car!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING
:Map_Menu_4
if  and
5@ > 800000
0039:   2@ ==  2  // integer values
jf @Map_Menu_5
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
// actor $PLAYER_ACTOR remove_weapons
0@ = car.Create(#DODO,  -2052.7058, -269.9372, 35.3203)
car.Angle(0@) =  351.3648
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
//CAR.SetImmunities(0@,1,1,1,1,1)
02AA: set_car 0@ immune_to_nonplayer 1
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -800000
actor.putat($PLAYER_ACTOR, -2055.665, -271.0942, 35.3203)
actor.Angle($PLAYER_ACTOR) = 356.9247
0ACB: show_styled_text "~w~You brought a Plane!" time 3000 style 5
gosub @2nd_warp_plane
jump @START_DRIVING

:Map_Menu_5
if  and
5@ > 9000
0039:   2@ ==  3  // integer values
jf @Map_Menu_6

01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0@ = car.Create(#Burrito, -2047.6837, -86.364, 35.1641)
car.Angle(0@) =  1.5691
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -9000
0ACB: show_styled_text "~w~You brought a van!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING //

:Map_Menu_6
if  and
5@ > 5000
0039:   2@ ==  4  // integer values
jf @Map_Menu_7
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
// actor $PLAYER_ACTOR remove_weapons
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281

0@ = car.Create(#peren, -2047.6837, -86.364, 35.1641)
car.Angle(0@) =  1.5691
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -5000
0ACB: show_styled_text "~w~You brought a Car!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING

:Map_Menu_7
if  and
5@ > 500000
0039:   2@ ==  5  // integer values
jf @Map_Menu_8
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
0@ = car.Create(#MAVERICK,  -2052.7058, -269.9372, 35.3203)
car.Angle(0@) =  351.3648
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -500000
actor.putat($PLAYER_ACTOR, -2055.665, -271.0942, 35.3203)
actor.Angle($PLAYER_ACTOR) = 356.9247
0ACB: show_styled_text "~w~You brought a Helicopter!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING


:Map_Menu_8
if  and
5@ > 20000
0039:   2@ ==  6  // integer values
jf @Map_Menu_9
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
0@ = car.Create(#VOODOO,  -2047.1519, -84.7965, 35.1641)
car.Angle(0@) =  351.3648
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -20000
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0ACB: show_styled_text "~w~You brought a car!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING


:Map_Menu_9
if  and
5@ > 750000
0039:   2@ ==  7  // integer values
jf @Map_Menu_10
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
0@ = car.Create(#BUS,  -2047.1519, -84.7965, 35.1641)
car.Angle(0@) =  351.3648
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -750000
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0ACB: show_styled_text "~w~You brought a bus!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING


:Map_Menu_10
if  and
5@ > 850000
0039:   2@ ==  8  // integer values
jf @Map_Menu_11
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
0@ = car.Create(#COACH,   -2047.1519, -84.7965, 35.1641)
car.Angle(0@) =  351.3648
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -850000
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0ACB: show_styled_text "~w~You brought a bus!" time 3000 style 5
gosub @2nd_warp

:Map_Menu_11
if  and
5@ > 70000
0039:   2@ ==  9  // integer values
jf @Map_Menu_1
01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
0@ = car.Create(#HUNTLEY,   -2047.1519, -84.7965, 35.1641)
car.Angle(0@) =  351.3648
car.Health(0@) = 50000000
//car.DoorStatus(13@, 4)
09C4: set_car 0@ gas_tank_explosion_enabled 0
0109: player $PLAYER_CHAR money -= -70000
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
0ACB: show_styled_text "~w~You brought a SUV!" time 3000 style 5
gosub @2nd_warp
jump @START_DRIVING

:Map_Menu_21

01B4: set_player $PLAYER_CHAR can_move 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone 0
08DA: remove_panel 1@
03E6: remove_text_box
actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
actor.Angle($PLAYER_ACTOR) = 9.7281
jump @BACK_MENU

:START_DRIVING
00BE: text_clear_all
audiostream.PerformAction($HELP1, stop)

0ACA: show_text_box "~w~Press ~y~CTRL + TAB~w~ to end driving."
camera.Restore_WithJumpCut()
camera.SetBehindPlayer()
audiostream.PerformAction($HELP2, play)
0ACD: show_text_highpriority "Drive to see you like it or not. If you break it, you pay for it! Hahaha!" time 7000
//actor.putat($PLAYER_ACTOR, -2050.7302, -83.5306, 35.1641)
//actor.Angle($PLAYER_ACTOR) = 9.7281

model.Destroy(#stallion)
model.Destroy(#pony) 
model.Destroy(#Rustler)    
model.Destroy(#DODO)  
model.Destroy(#Burrito) 
model.Destroy(#peren)
model.Destroy(#MAVERICK)
jump @CAR_HIT1

:2nd_warp
wait 0
if
056D:   actor $SECOND_PLAYER_ACTOR defined
jf @skip2
actor.putat($SECOND_PLAYER_ACTOR, -2044.561, -82.6767, 35.1641)
actor.Angle($SECOND_PLAYER_ACTOR) = 11.4104
return
:skip2
return

:2nd_warp_plane
wait 0
if
056D:   actor $SECOND_PLAYER_ACTOR defined
jf @skip3
actor.putat($SECOND_PLAYER_ACTOR,  -2047.5251, -269.0708, 35.3203)
actor.Angle($SECOND_PLAYER_ACTOR) =  359.9983
return
:skip3
return

:CAR_HIT1
wait 0
if  
056E:   car 0@ defined
jf @repair_Car
if and
50@ == 0
03C9:   car 0@ damaged

jf @repair_Car
0325: 80@ = create_car 0@ fire
//041E: set_radio_station 0

054F: clear_car 0@ damage
//car.Health(0@) = 500
///067F: set_car 1@ lights 2
02D4: car 0@ turn_off_engine
081D: set_car 0@ engine_broken 1
50@ = 1
//02AC: set_car 0@ immunities BP 1 FP 1 EP 1 CP 1 MP 1

jump @repair_Car

:repair_Car
gosub @DEAD
gosub @2nd_p2_fix
if and
0206:   actor $PLAYER_ACTOR near_car 0@ radius 5.0 5.0 5.0 flag 0 on_foot
50@ == 1
//03C9:   car 0@ damaged
jf @LOOP_3 
0ACD: show_text_highpriority "Press ~y~~k~~CONVERSATION_YES~~w~ to repair the broken car." time 500
if      
00E1:   player 0 pressed_key 11
jf @LOOP_3 
50@ = 0
//car.Health(0@) = 5000000000
audiostream.PerformAction($FIX, play)
0A30: repair_car 0@
02D1: remove_fire 80@
081D: set_car 0@ engine_broken 0
//02AC: set_car 0@ immunities BP 0 FP 0 EP 0 CP 0 MP 0

:LOOP_3    
gosub @DAMAGE_P2                  
if and
051C:   car 0@ damaged_by_actor $PLAYER_ACTOR
//056C:   actor $PLAYER_ACTOR driving_police_car
0137:   car 0@ model == #MAVERICK


//0820:   model 0@ heli
//051C:   car 0@ damaged_by_actor $PLAYER_ACTOR

jf @LOOP_2
//0724: heli 0@ follow_and_attack_player $PLAYER_CHAR radius 8000.0
0825: set_helicopter 0@ instant_rotor_start
0A1C: set_helicopter 0@ play_engine_sounds 1
0727: set_heli 0@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 80000.0


:LOOP_2
gosub @DEAD
jump @CAR_HIT1

:DAMAGE_P2
if
056D:   actor $SECOND_PLAYER_ACTOR defined

jf @whatever
if
051C:   car 0@ damaged_by_actor $SECOND_PLAYER_ACTOR
jf @whatever
0825: set_helicopter 0@ instant_rotor_start
0A1C: set_helicopter 0@ play_engine_sounds 1
0727: set_heli 0@ behavior_to_police_heli_and_follow_actor $PLAYER_ACTOR follow_car -1 radius 80000.0


:whatever
return


:TEXT
//0ACA: show_text_box "Press ~y~SHIFT + TAB~w~ to abort the fight."

:DEAD
wait 0
if 
player.Wasted($PLAYER_CHAR)
jf @EXIT_MATCH
0ACB: show_styled_text "~r~You died!" time 3000 style 5

jump @cleanup

:EXIT_MATCH
if and
0AB0:   key_pressed 17 
0AB0:   key_pressed 9 
jf @return

:2nd_player_car
wait 0
if
056D:   actor $SECOND_PLAYER_ACTOR defined
jf @skip
if
056E:   car 0@ defined
jf @skip
if
actor.InCar($SECOND_PLAYER_ACTOR, 0@)
jf @skip
//actor.PutAt($SECOND_PLAYER_ACTOR, -2041.4218, -104.7618, 35.1794)
0362: remove_actor $SECOND_PLAYER_ACTOR from_car_and_place_at  -2013.9309 -111.2473 35.2188
:skip
audiostream.PerformAction($HELP2, stop)
audiostream.PerformAction($HELP3, play)
0ACB: show_styled_text "~w~What? You car got broken?" time 3000 style 5
wait 3500
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at  -2017.5422 -108.8756 35.0525

0151: remove_status_text $score
014F: stop_timer $timer
mission_cleanup
jump @RELOADED         

:return
return

:cleanup
062A: change_float_stat 24 to 1440.0 
//$ONMISSION = 0
actor.PutAt($PLAYER_ACTOR , -2039.9172, -87.4175, 35.3203)
actor.Angle($PLAYER_ACTOR) = 16.0429
0151: remove_status_text $score
014F: stop_timer $timer
$ONMISSION = 0
mission_cleanup
audiostream.Release($HELP1)
audiostream.Release($HELP2)
audiostream.Release($HELP3)
audiostream.Release($FIX)
audiostream.PerformAction($HELP4, play)
0ACD: show_text_highpriority "I hope you'll have a great time, dude. Comeback when you want to drive again. Hahaha!" time 7000
wait 7500
audiostream.Release($HELP4)

end_thread


:2nd_p2_fix
if and
50@ == 1
056D:   actor $SECOND_PLAYER_ACTOR defined
jf @whatever2
if
0206:   actor $SECOND_PLAYER_ACTOR near_car 0@ radius 5.0 5.0 5.0 flag 0 on_foot
jf @whatever2
if
0ACD: show_text_highpriority "Press ~y~~k~~CONVERSATION_YES~~w~ to repair the broken car." time 500
if    
00E1:   player 1 pressed_key 11

jf @whatever2 
50@ = 0
//car.Health(0@) = 5000000000
audiostream.PerformAction($FIX, play)
0A30: repair_car 0@
02D1: remove_fire 80@
081D: set_car 0@ engine_broken 0
//02AC: set_car 0@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
return

:whatever2
return
